package org.jeecg.modules.tankerRegistration.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.tankerRegistration.entity.TankerRegistration;

import java.util.List;

/**
 * @Description: 罐车登记表
 * @Author: jeecg-boot
 * @Date:   2024-10-28
 * @Version: V1.0
 */
public interface TankerRegistrationMapper extends BaseMapper<TankerRegistration> {

    @Select("SELECT * FROM tanker_registration " +
            "WHERE DATE_FORMAT(create_time, '%Y-%m-%d') = #{createTime};")
    List<TankerRegistration> getBackups(@Param("createTime") String createTime);

//    @Select("SELECT *  FROM tanker_registration " +
//            "WHERE create_time between #{createTime} AND #{endTime};")
//    List<TankerRegistration> getBackups(
//            @Param("createTime") String createTime,
//            @Param("endTime") String endTime);

    @Select("SELECT * FROM tanker_registration " +
            "WHERE create_time between #{createTime} AND #{endTime};")
    List<TankerRegistration> getBackups(
            @Param("createTime") String createTime,
            @Param("endTime") String endTime);

}
